@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">

            <input type="hidden" id="id" value="${item.id}">
            <input type="hidden" id="status">
            <input type="hidden" id="remark" value="${item.remark}">
            <input type="hidden" id="viewmark" value="${item.viewmark}">
            <input type="hidden" id="isannexvalue" value="${item.isannex}">
            <div class="row">
                <div class="col-sm-12">
                    <#input id="projectname" name="项目名称" value="${item.projectname}" underline="true"
                    readonly="readonly"/>
                    <#input id="address" name="项目地址" value="${item.address}" underline="true" readonly="readonly"/>
                    <#input id="addressdetail" name="项目详细地址" value="${item.addressdetail}" underline="true"
                    readonly="readonly"/>
                    <#input id="contacter" name="项目联系人" value="${item.contacter}" underline="true" readonly="readonly"/>
                    <#input id="phone" name="项目联系电话" value="${item.phone}" underline="true" readonly="readonly"/>
                    <#input id="conunit" name="项目建设单位" value="${item.conunit}" underline="true" readonly="readonly"/>
                    <#input id="totaluinit" name="项目总包单位" value="${item.totaluinit}" underline="true" readonly="readonly"/>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">项目概况</label>
                        <div class="col-sm-10">
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" name="btSelectItem" id="g1" disabled value="1"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i>是否打桩
                                </label>
                            </div>
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" id="g2" disabled name="btSelectItem" value="2"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i>是否基坑开挖
                                </label>
                            </div>
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" id="g3" disabled name="btSelectItem" value="3"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i>是否已做防水层
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-10">
                            <textarea class="form-control" id="overview" value="${item.overview}"
                                      readonly="readonly"></textarea>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <#input id="quantity" name="项目工程量" value="${item.quantity}" underline="true" readonly="readonly"/>
                    <#input id="isannex" name="项目附件" value="${item.isannex}" underline="true" readonly="readonly"/>
                    <#input id="projectremark" name="项目备注" value="${item.projectremark}" underline="true"
                    readonly="readonly"/>
                    <#input id="submitterphone" name="提交人电话" value="${item.submitterphone}" underline="true"
                    readonly="readonly"/>
                    <#input id="bankcode" name="银行卡号" value="${item.bankcode}" underline="true" readonly="readonly"/>
                    <#input id="bankname" name="开户行" value="${item.bankname}" underline="true" readonly="readonly"/>
                    <#input id="cardholder" name="持卡人姓名" value="${item.cardholder}" underline="true"
                    readonly="readonly"/>
                    <#input id="alipay" name="支付宝" value="${item.alipay}" underline="true" readonly="readonly"/>
                    <#input id="alipayname" name="支付宝姓名" value="${item.alipayname}" underline="true"
                    readonly="readonly"/>
                    <#input id="wechat" name="微信" value="${item.wechat}" underline="true" readonly="readonly"/>
                    <#input id="subtime" name="提交时间" value="${item.subtime}" underline="true" readonly="readonly"/>
                    <#input id="auditmoney" type="number" name="审核金额" underline="true"/>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-10">
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" name="btSelectItem" id="r1" value="1"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i>项目不存在
                                </label>
                            </div>
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" id="r2" name="btSelectItem" value="2"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i> 项目地址不对
                                </label>
                            </div>
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" name="btSelectItem" id="r3" value="3"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i> 项目负责人不对
                                </label>
                            </div>
                            <div class="checkbox i-checks">
                                <label style="padding-left: 0px">
                                    <div class="icheckbox_square-green" style="position: relative;">
                                        <input type="checkbox" id="r4" name="btSelectItem" value="4"
                                               style="position: absolute; opacity: 0;">
                                        <ins class="iCheck-helper"
                                             style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                    </div>
                                    <i></i> 项目负责人联系方式不对
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-10">
                            <textarea class="form-control" id="auditremark" value="${item.overview}"></textarea>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-12" style="text-align: center">
                    <#button btnCss="info" name="通过" id="ensure" icon="fa-check"
                    clickFun="ok()"/>
                    <#button btnCss="info" name="未通过" id="ensure" icon="fa-check"
                    clickFun="no()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser"
                    clickFun="ProjectinfoInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/projectinfo/projectinfo/projectinfo_info.js"></script>
<script src="${ctxPath}/static/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(
        function () {
            $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
            //审核备注勾选
            if ($("#remark").val() != "" || $("#remark").val() != null) {
                var str = $("#remark").val();
                if ((str.indexOf(1) != -1) == true) {
                    $("#r1").iCheck("check");
                }
                if ((str.indexOf(2) != -1) == true) {
                    $("#r2").iCheck("check");
                }
                if ((str.indexOf(3) != -1) == true) {
                    $("#r3").iCheck("check");
                }
                if ((str.indexOf(4) != -1) == true) {
                    $("#r4").iCheck("check");
                }
            }
            //概况备注勾选
            if ($("#viewmark").val() != "" || $("#viewmark").val() != null) {
                var str = $("#viewmark").val();
                if ((str.indexOf(1) != -1) == true) {
                    $("#g1").iCheck("check");
                }
                if ((str.indexOf(2) != -1) == true) {
                    $("#g2").iCheck("check");
                }
                if ((str.indexOf(3) != -1) == true) {
                    $("#g3").iCheck("check");
                }
            }
            //附件转义
            if ($("#isannexvalue").val() == 1) {
                $("#isannex").val("有")
            } else {
                $("#isannex").val("没有")
            }
        });

    function ok() {
        $("#status").val(1);
        if ($("#auditmoney").val() == "" || $("#auditmoney").val() == null) {
            Feng.error("请填写审核金额!");
            return;
        }
        ProjectinfoInfoDlg.editSubmit()
    }

    function no() {
        $("#status").val(2);
        var arrChk = $("input[name='btSelectItem']:checked");
        var idstr = '';
        //遍历得到每个checkbox的value值
        for (var i = 0; i < arrChk.length; i++) {
            idstr += '"' + arrChk[i].value + '"' + ',';
        }
        if (idstr.length > 0 || $("#auditremark").val() != "") {
            idstr = '[' + idstr.substr(0, idstr.length - 1) + ']';
            $("#remark").val(idstr);
            ProjectinfoInfoDlg.editSubmit()
        } else {
            Feng.error("请选择审核备注!");
            return;
        }
    }

</script>
@}
